home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 02 - 1986 / 02.06 Jun 86.sit / 02.06 Jun 86 / Pascal source / viddemo.Pas < prev    next >
MacBinary  |  1986-05-06  |  8.4 KB  |  [TEXT/EDIT]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert TheDraw Pascal screen Image (image/theDrawPascalScreenImage) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue May 6 10:52:20 1986, modified Tue May 6 10:52:20 1986, creator Macintosh Edit, type ASCII, 8032 bytes "viddemo.Pas" , at 0x1fe0 348 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[EDIT]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 76 69 64 64 65 6d | 6f 2e 50 61 73 00 00 00 |..viddem|o.Pas...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 45 44 49 | 54 01 00 00 00 00 00 00 |.TEXTEDI|T.......|
|00000050| 00 00 00 00 00 1f 60 00 | 00 01 5c 9a e3 cb 24 9a |......`.|..\...$.|
|00000060| e3 cb 24 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..$.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 53 a7 00 00 |........|....S...|
|00000080| 7b 20 76 69 64 64 65 6d | 6f 20 2d 2d 20 41 20 73 |{ viddem|o -- A s|
|00000090| 69 6d 70 6c 65 20 70 72 | 6f 67 72 61 6d 20 74 6f |imple pr|ogram to|
|000000a0| 20 64 65 6d 6f 6e 73 74 | 72 61 74 65 20 74 68 65 | demonst|rate the|
|000000b0| 20 d2 76 69 64 d3 20 72 | 6f 75 74 69 6e 65 73 2c | .vid. r|outines,|
|000000c0| 20 77 68 69 63 68 20 61 | 6c 6c 6f 77 0d 20 20 73 | which a|llow. s|
|000000d0| 77 69 74 63 68 69 6e 67 | 20 62 65 74 77 65 65 6e |witching| between|
|000000e0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 61 6e 64 | the def|ault and|
|000000f0| 20 61 6c 74 65 72 6e 61 | 74 65 20 76 69 64 65 6f | alterna|te video|
|00000100| 20 73 63 72 65 65 6e 73 | 20 69 6e 20 73 79 6e 63 | screens| in sync|
|00000110| 20 77 69 74 68 20 74 68 | 65 0d 20 20 73 63 72 65 | with th|e. scre|
|00000120| 65 6e 20 72 65 66 72 65 | 73 68 2c 20 61 6c 6c 6f |en refre|sh, allo|
|00000130| 77 69 6e 67 20 66 6c 69 | 63 6b 65 72 2d 66 72 65 |wing fli|cker-fre|
|00000140| 65 20 61 6e 69 6d 61 74 | 69 6f 6e 2e 0d 20 20 20 |e animat|ion.. |
|00000150| 20 20 20 20 20 6d 69 6b | 65 20 6d 6f 72 74 6f 6e | mik|e morton|
|00000160| 2c 20 6d 61 79 20 31 39 | 38 36 0d 7d 0d 0d 0d 70 |, may 19|86.}...p|
|00000170| 72 6f 67 72 61 6d 20 76 | 69 64 64 65 6d 6f 3b 09 |rogram v|iddemo;.|
|00000180| 09 20 20 20 20 20 20 20 | 20 7b 20 64 65 6d 6f 6e |. | { demon|
|00000190| 73 74 72 61 74 65 20 73 | 63 72 65 65 6e 2d 73 77 |strate s|creen-sw|
|000001a0| 69 74 63 68 69 6e 67 20 | 7d 0d 0d 7b 24 69 20 4d |itching |}..{$i M|
|000001b0| 65 6d 54 79 70 65 73 2e | 69 70 61 73 20 20 7d 0d |emTypes.|ipas }.|
|000001c0| 7b 24 69 20 51 75 69 63 | 6b 44 72 61 77 2e 69 70 |{$i Quic|kDraw.ip|
|000001d0| 61 73 20 7d 0d 7b 24 69 | 20 4f 53 49 6e 74 66 2e |as }.{$i| OSIntf.|
|000001e0| 69 70 61 73 20 20 20 20 | 7d 0d 7b 24 69 20 54 6f |ipas |}.{$i To|
|000001f0| 6f 6c 49 6e 74 66 2e 69 | 70 61 73 20 20 7d 0d 0d |olIntf.i|pas }..|
|00000200| 20 20 63 6f 6e 73 74 0d | 20 20 20 20 74 69 63 6b | const.| tick|
|00000210| 72 61 74 65 20 3d 20 31 | 3b 09 09 20 20 20 20 20 |rate = 1|;.. |
|00000220| 20 20 20 7b 20 74 69 63 | 6b 73 20 62 65 74 77 65 | { tic|ks betwe|
|00000230| 65 6e 20 61 6e 69 6d 61 | 74 69 6f 6e 20 66 72 61 |en anima|tion fra|
|00000240| 6d 65 73 20 7d 0d 20 20 | 20 20 77 69 64 74 68 20 |mes }. | width |
|00000250| 3d 20 31 32 30 3b 09 09 | 20 20 20 20 20 20 20 20 |= 120;..| |
|00000260| 7b 20 73 69 7a 65 20 6f | 66 20 74 68 65 20 6d 6f |{ size o|f the mo|
|00000270| 76 69 6e 67 20 73 71 75 | 61 72 65 20 7d 0d 20 20 |ving squ|are }. |
|00000280| 20 20 7b 20 50 61 72 61 | 6d 65 74 65 72 73 20 66 | { Para|meters f|
|00000290| 6f 72 20 74 68 65 20 d2 | 76 69 64 69 6e 66 6f 2e |or the .|vidinfo.|
|000002a0| 72 65 71 75 65 73 74 d3 | 20 66 69 65 6c 64 2e 20 |request.| field. |
|000002b0| 7d 0d 20 20 20 20 72 65 | 71 61 6c 74 20 3d 20 30 |}. re|qalt = 0|
|000002c0| 3b 09 09 09 20 20 20 20 | 20 20 20 20 7b 20 72 65 |;... | { re|
|000002d0| 71 75 65 73 74 20 73 77 | 69 74 63 68 20 74 6f 20 |quest sw|itch to |
|000002e0| 61 6c 74 65 72 6e 61 74 | 65 20 73 63 72 65 65 6e |alternat|e screen|
|000002f0| 20 7d 0d 20 20 20 20 72 | 65 71 64 65 66 20 3d 20 | }. r|eqdef = |
|00000300| 31 3b 09 09 09 20 20 20 | 20 20 20 20 20 7b 20 72 |1;... | { r|
|00000310| 65 71 75 65 73 74 20 73 | 77 69 74 63 68 20 74 6f |equest s|witch to|
|00000320| 20 64 65 66 61 75 6c 74 | 20 73 63 72 65 65 6e 20 | default| screen |
|00000330| 7d 0d 20 20 20 20 72 65 | 71 73 74 6f 70 20 3d 20 |}. re|qstop = |
|00000340| 32 3b 09 09 20 20 20 20 | 20 20 20 20 7b 20 72 65 |2;.. | { re|
|00000350| 71 75 65 73 74 20 64 65 | 66 61 75 6c 74 20 73 63 |quest de|fault sc|
|00000360| 72 65 65 6e 3b 20 73 74 | 6f 70 20 74 61 73 6b 20 |reen; st|op task |
|00000370| 7d 0d 0d 20 20 74 79 70 | 65 0d 20 20 20 20 73 63 |}.. typ|e. sc|
|00000380| 72 65 65 6e 74 79 70 65 | 20 3d 20 28 64 65 66 61 |reentype| = (defa|
|00000390| 75 6c 74 2c 20 61 6c 74 | 65 72 6e 61 74 65 29 3b |ult, alt|ernate);|
|000003a0| 20 20 7b 20 77 68 69 63 | 68 20 73 63 72 65 65 6e | { whic|h screen|
|000003b0| 20 69 73 20 63 75 72 72 | 65 6e 74 6c 79 20 73 68 | is curr|ently sh|
|000003c0| 6f 77 69 6e 67 3f 20 7d | 0d 20 20 20 20 76 69 64 |owing? }|. vid|
|000003d0| 69 6e 66 6f 20 3d 20 72 | 65 63 6f 72 64 09 09 20 |info = r|ecord.. |
|000003e0| 20 20 20 20 20 20 20 7b | 20 64 61 74 61 20 73 74 | {| data st|
|000003f0| 72 75 63 74 75 72 65 20 | 66 6f 72 20 d2 76 69 64 |ructure |for .vid|
|00000400| d3 20 72 6f 75 74 69 6e | 65 73 20 7d 0d 20 20 20 |. routin|es }. |
|00000410| 20 20 20 76 3a 20 56 42 | 4c 54 61 73 6b 3b 09 09 | v: VB|LTask;..|
|00000420| 20 20 20 20 20 20 20 20 | 7b 20 74 68 65 20 76 65 | |{ the ve|
|00000430| 72 74 69 63 61 6c 20 72 | 65 74 72 61 63 65 20 74 |rtical r|etrace t|
|00000440| 61 73 6b 20 62 6c 6f 63 | 6b 20 7d 0d 20 20 20 20 |ask bloc|k }. |
|00000450| 20 20 72 65 71 75 65 73 | 74 3a 20 69 6e 74 65 67 | reques|t: integ|
|00000460| 65 72 3b 09 09 20 20 20 | 20 20 20 20 20 7b 20 63 |er;.. | { c|
|00000470| 75 72 72 65 6e 74 20 72 | 65 71 75 65 73 74 3a 20 |urrent r|equest: |
|00000480| 61 6c 74 2f 64 65 66 2f | 73 74 6f 70 2f 6e 6f 6e |alt/def/|stop/non|
|00000490| 65 20 7d 0d 20 20 20 20 | 20 20 70 65 72 69 6f 64 |e }. | period|
|000004a0| 3a 20 69 6e 74 65 67 65 | 72 3b 09 09 20 20 20 20 |: intege|r;.. |
|000004b0| 20 20 20 20 7b 20 74 69 | 63 6b 73 20 62 65 74 77 | { ti|cks betw|
|000004c0| 65 65 6e 20 61 6e 69 6d | 61 74 69 6f 6e 20 66 72 |een anim|ation fr|
|000004d0| 61 6d 65 73 20 7d 0d 20 | 20 20 20 20 20 64 65 6c |ames }. | del|
|000004e0| 61 79 73 3a 20 6c 6f 6e | 67 69 6e 74 3b 09 09 20 |ays: lon|gint;.. |
|000004f0| 20 20 20 20 20 20 20 7b | 20 6e 75 6d 62 65 72 20 | {| number |
|00000500| 6f 66 20 64 65 6c 61 79 | 73 20 6f 62 73 65 72 76 |of delay|s observ|
|00000510| 65 64 20 7d 0d 20 20 20 | 20 65 6e 64 3b 0d 0d 20 |ed }. | end;.. |
|00000520| 20 76 61 72 0d 20 20 20 | 20 6d 79 50 6f 72 74 3a | var. | myPort:|
|00000530| 20 67 72 61 66 50 6f 72 | 74 3b 09 09 20 20 20 20 | grafPor|t;.. |
|00000540| 20 20 20 20 7b 20 6f 75 | 72 20 67 72 61 70 68 69 | { ou|r graphi|
|00000550| 63 73 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 7d |cs envir|onment }|
|00000560| 0d 20 20 20 20 76 68 2c | 20 76 76 3a 20 69 6e 74 |. vh,| vv: int|
|00000570| 65 67 65 72 3b 09 09 20 | 20 20 20 20 20 20 20 7b |eger;.. | {|
|00000580| 20 76 65 6c 6f 63 69 74 | 79 3a 20 68 20 61 6e 64 | velocit|y: h and|
|00000590| 20 76 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 7d 0d | v compo|nents }.|
|000005a0| 20 20 20 20 62 6c 6f 63 | 6b 72 65 63 74 3a 20 72 | bloc|krect: r|
|000005b0| 65 63 74 3b 09 09 20 20 | 20 20 20 20 20 20 7b 20 |ect;.. | { |
|000005c0| 72 65 63 74 61 6e 67 6c | 65 20 77 68 65 72 65 20 |rectangl|e where |
|000005d0| 62 6f 75 6e 63 69 6e 67 | 20 62 6c 6f 63 6b 20 69 |bouncing| block i|
|000005e0| 73 20 7d 0d 20 20 20 20 | 62 6f 75 6e 64 73 72 65 |s }. |boundsre|
|000005f0| 63 74 3a 20 72 65 63 74 | 3b 09 09 20 20 20 20 20 |ct: rect|;.. |
|00000600| 20 20 20 7b 20 6c 61 72 | 67 65 20 72 65 63 74 20 | { lar|ge rect |
|00000610| 69 6e 20 77 68 69 63 68 | 20 62 6c 6f 63 6b 20 62 |in which| block b|
|00000620| 6f 75 6e 63 65 73 20 7d | 0d 20 20 20 20 61 6e 65 |ounces }|. ane|
|00000630| 76 65 6e 74 3a 20 65 76 | 65 6e 74 72 65 63 6f 72 |vent: ev|entrecor|
|00000640| 64 3b 09 20 20 20 20 20 | 20 20 20 7b 20 66 6f 72 |d;. | { for|
|00000650| 20 61 77 61 69 74 69 6e | 67 20 6b 65 79 73 74 72 | awaitin|g keystr|
|00000660| 6f 6b 65 20 6f 72 20 63 | 6c 69 63 6b 20 7d 0d 20 |oke or c|lick }. |
|00000670| 20 20 20 74 68 65 69 6e | 66 6f 3a 20 76 69 64 69 | thein|fo: vidi|
|00000680| 6e 66 6f 3b 09 09 20 20 | 20 20 20 20 20 20 7b 20 |nfo;.. | { |
|00000690| 69 6e 66 6f 20 73 68 61 | 72 65 64 20 77 69 74 68 |info sha|red with|
|000006a0| 20 76 69 64 20 72 6f 75 | 74 69 6e 65 73 20 7d 0d | vid rou|tines }.|
|000006b0| 20 20 20 20 61 6c 74 62 | 69 74 73 3a 20 62 69 74 | altb|its: bit|
|000006c0| 6d 61 70 3b 09 09 20 20 | 20 20 20 20 20 20 7b 20 |map;.. | { |
|000006d0| 62 69 74 6d 61 70 20 66 | 6f 72 20 61 6c 74 65 72 |bitmap f|or alter|
|000006e0| 6e 61 74 65 20 73 63 72 | 65 65 6e 20 7d 0d 20 20 |nate scr|een }. |
|000006f0| 20 20 77 68 69 63 68 73 | 63 72 3a 20 73 63 72 65 | whichs|cr: scre|
|00000700| 65 6e 74 79 70 65 3b 09 | 20 20 20 20 20 20 20 20 |entype;.| |
|00000710| 7b 20 61 72 65 20 77 65 | 20 6f 6e 20 61 6c 74 65 |{ are we| on alte|
|00000720| 72 6e 61 74 65 2f 64 65 | 66 61 75 6c 74 20 73 63 |rnate/de|fault sc|
|00000730| 72 65 65 6e 3f 20 7d 0d | 20 20 20 20 64 65 66 6c |reen? }.| defl|
|00000740| 61 73 74 2c 20 61 6c 74 | 6c 61 73 74 3a 20 72 65 |ast, alt|last: re|
|00000750| 63 74 3b 09 20 20 20 20 | 20 20 20 20 7b 20 72 65 |ct;. | { re|
|00000760| 63 74 61 6e 67 6c 65 20 | 77 65 20 6c 61 73 74 20 |ctangle |we last |
|00000770| 64 72 65 77 20 69 6e 20 | 7d 0d 20 20 20 20 7a 6f |drew in |}. zo|
|00000780| 74 3a 20 6c 6f 6e 67 69 | 6e 74 3b 09 09 20 20 20 |t: longi|nt;.. |
|00000790| 20 20 20 20 20 7b 20 74 | 68 72 6f 77 61 77 61 79 | { t|hrowaway|
|000007a0| 20 72 65 73 75 6c 74 20 | 66 6f 72 20 66 75 6e 63 | result |for func|
|000007b0| 74 69 6f 6e 73 20 7d 0d | 20 20 20 20 0d 20 20 20 |tions }.| . |
|000007c0| 20 0d 20 20 20 20 74 6f | 74 66 72 65 65 74 69 6d | . to|tfreetim|
|000007d0| 65 3a 20 6c 6f 6e 67 69 | 6e 74 3b 09 20 20 20 20 |e: longi|nt;. |
|000007e0| 20 20 20 20 7b 20 73 74 | 61 74 69 73 74 69 63 73 | { st|atistics|
|000007f0| 3a 20 61 63 63 75 6d 75 | 6c 61 74 65 64 20 66 72 |: accumu|lated fr|
|00000800| 65 65 20 74 69 6d 65 20 | 7d 0d 20 20 20 20 73 61 |ee time |}. sa|
|00000810| 6d 70 6c 65 73 3a 20 6c | 6f 6e 67 69 6e 74 3b 09 |mples: l|ongint;.|
|00000820| 09 20 20 20 20 20 20 20 | 20 7b 20 73 74 61 74 69 |. | { stati|
|00000830| 73 74 69 63 73 3a 20 6e | 75 6d 62 65 72 20 6f 66 |stics: n|umber of|
|00000840| 20 73 61 6d 70 6c 65 73 | 20 7d 0d 0d 20 20 66 75 | samples| }.. fu|
|00000850| 6e 63 74 69 6f 6e 20 20 | 76 69 64 77 61 69 74 20 |nction |vidwait |
|00000860| 20 20 20 28 56 41 52 20 | 62 6c 6f 63 6b 3a 20 76 | (VAR |block: v|
|00000870| 69 64 69 6e 66 6f 29 3a | 20 6c 6f 6e 67 69 6e 74 |idinfo):| longint|
|00000880| 3b 09 20 20 20 20 20 20 | 20 65 78 74 65 72 6e 61 |;. | externa|
|00000890| 6c 3b 0d 20 20 70 72 6f | 63 65 64 75 72 65 20 76 |l;. pro|cedure v|
|000008a0| 69 64 73 74 61 72 74 20 | 20 20 28 56 41 52 20 62 |idstart | (VAR b|
|000008b0| 6c 6f 63 6b 3a 20 76 69 | 64 69 6e 66 6f 3b 20 70 |lock: vi|dinfo; p|
|000008c0| 65 72 69 6f 64 3a 20 69 | 6e 74 65 67 65 72 29 3b |eriod: i|nteger);|
|000008d0| 20 20 65 78 74 65 72 6e | 61 6c 3b 0d 20 20 70 72 | extern|al;. pr|
|000008e0| 6f 63 65 64 75 72 65 20 | 67 65 74 61 6c 74 73 63 |ocedure |getaltsc|
|000008f0| 72 65 65 6e 3b 09 09 09 | 09 20 20 20 20 20 20 20 |reen;...|. |
|00000900| 65 78 74 65 72 6e 61 6c | 3b 0d 0d 20 20 70 72 6f |external|;.. pro|
|00000910| 63 65 64 75 72 65 20 69 | 6e 69 74 3b 09 09 20 20 |cedure i|nit;.. |
|00000920| 20 20 20 20 20 20 7b 20 | 69 6e 69 74 69 61 6c 69 | { |initiali|
|00000930| 7a 65 20 65 76 65 72 79 | 74 68 69 6e 67 20 7d 0d |ze every|thing }.|
|00000940| 20 20 62 65 67 69 6e 3b | 0d 20 20 20 20 20 20 49 | begin;|. I|
|00000950| 6e 69 74 47 72 61 66 28 | 40 74 68 65 50 6f 72 74 |nitGraf(|@thePort|
|00000960| 29 3b 09 20 20 20 20 20 | 20 20 20 7b 20 66 69 72 |);. | { fir|
|00000970| 65 20 75 70 20 71 75 69 | 63 6b 64 72 61 77 20 7d |e up qui|ckdraw }|
|00000980| 0d 20 20 20 20 20 20 4f | 70 65 6e 50 6f 72 74 28 |. O|penPort(|
|00000990| 40 6d 79 50 6f 72 74 29 | 3b 09 20 20 20 20 20 20 |@myPort)|;. |
|000009a0| 20 20 7b 20 67 65 74 20 | 61 20 64 72 61 77 69 6e | { get |a drawin|
|000009b0| 67 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 7d 0d |g enviro|nment }.|
|000009c0| 20 20 20 20 20 20 49 6e | 69 74 46 6f 6e 74 73 3b | In|itFonts;|
|000009d0| 09 09 20 20 20 20 20 20 | 20 20 7b 20 66 6f 72 20 |.. | { for |
|000009e0| 77 72 69 74 65 6c 6e 73 | 20 7d 0d 20 20 20 20 20 |writelns| }. |
|000009f0| 20 49 6e 69 74 43 75 72 | 73 6f 72 3b 09 09 20 20 | InitCur|sor;.. |
|00000a00| 20 20 20 20 20 20 7b 20 | 73 65 74 20 74 68 65 20 | { |set the |
|00000a10| 61 72 72 6f 77 20 63 75 | 72 73 6f 72 20 7d 0d 20 |arrow cu|rsor }. |
|00000a20| 20 20 20 20 20 48 69 64 | 65 43 75 72 73 6f 72 3b | Hid|eCursor;|
|00000a30| 09 09 20 20 20 20 20 20 | 20 20 7b 20 62 75 74 20 |.. | { but |
|00000a40| 77 65 20 64 6f 6e 27 74 | 20 77 61 6e 74 20 69 74 |we don't| want it|
|00000a50| 20 7d 0d 20 20 20 20 20 | 20 0d 20 20 20 20 20 20 | }. | . |
|00000a60| 62 6f 75 6e 64 73 72 65 | 63 74 20 3a 3d 20 73 63 |boundsre|ct := sc|
|00000a70| 72 65 65 6e 62 69 74 73 | 2e 62 6f 75 6e 64 73 3b |reenbits|.bounds;|
|00000a80| 20 20 7b 20 64 69 73 70 | 6c 61 79 20 72 65 63 74 | { disp|lay rect|
|00000a90| 61 6e 67 6c 65 20 69 73 | 20 66 75 6c 6c 20 73 63 |angle is| full sc|
|00000aa0| 72 65 65 6e c9 20 7d 0d | 20 20 20 20 20 20 49 6e |reen. }.| In|
|00000ab0| 73 65 74 52 65 63 74 20 | 28 62 6f 75 6e 64 73 72 |setRect |(boundsr|
|00000ac0| 65 63 74 2c 20 31 35 2c | 20 31 35 29 3b 20 20 20 |ect, 15,| 15); |
|00000ad0| 7b 20 c9 69 6e 73 65 74 | 20 61 20 62 69 74 20 7d |{ .inset| a bit }|
|00000ae0| 0d 0d 20 20 20 20 20 20 | 53 65 74 52 65 63 74 20 |.. |SetRect |
|00000af0| 28 62 6c 6f 63 6b 72 65 | 63 74 2c 20 30 2c 20 30 |(blockre|ct, 0, 0|
|00000b00| 20 2c 20 77 69 64 74 68 | 2c 20 77 69 64 74 68 29 | , width|, width)|
|00000b10| 3b 20 7b 20 6d 61 6b 65 | 20 75 70 20 72 65 63 74 |; { make| up rect|
|00000b20| 20 66 6f 72 20 73 71 75 | 61 72 65 20 7d 0d 20 20 | for squ|are }. |
|00000b30| 20 20 20 20 4f 66 66 73 | 65 74 52 65 63 74 20 28 | Offs|etRect (|
|00000b40| 62 6c 6f 63 6b 72 65 63 | 74 2c 20 31 35 2c 20 31 |blockrec|t, 15, 1|
|00000b50| 35 29 3b 20 20 20 7b 20 | 73 74 61 72 74 20 69 74 |5); { |start it|
|00000b60| 20 69 6e 20 74 68 65 20 | 62 6f 75 6e 64 73 20 72 | in the |bounds r|
|00000b70| 65 63 74 61 6e 67 6c 65 | 20 7d 0d 20 20 20 20 20 |ectangle| }. |
|00000b80| 20 61 6c 74 6c 61 73 74 | 20 3a 3d 20 62 6c 6f 63 | altlast| := bloc|
|00000b90| 6b 72 65 63 74 3b 20 64 | 65 66 6c 61 73 74 20 3a |krect; d|eflast :|
|00000ba0| 3d 20 62 6c 6f 63 6b 72 | 65 63 74 3b 20 7b 20 69 |= blockr|ect; { i|
|00000bb0| 6e 69 74 20 d2 6f 6c 64 | d3 20 70 6f 73 69 74 69 |nit .old|. positi|
|00000bc0| 6f 6e 73 20 7d 0d 0d 20 | 20 20 20 20 20 61 6c 74 |ons }.. | alt|
|00000bd0| 62 69 74 73 20 3a 3d 20 | 73 63 72 65 65 6e 62 69 |bits := |screenbi|
|00000be0| 74 73 3b 09 20 20 20 20 | 20 20 20 20 7b 20 61 6c |ts;. | { al|
|00000bf0| 74 2e 20 73 63 72 65 65 | 6e 20 69 73 20 74 68 65 |t. scree|n is the|
|00000c00| 20 75 73 75 61 6c 2c 20 | 62 75 74 c9 20 7d 0d 20 | usual, |but. }. |
|00000c10| 20 20 20 20 20 77 69 74 | 68 20 61 6c 74 62 69 74 | wit|h altbit|
|00000c20| 73 20 64 6f 09 09 20 20 | 20 20 20 20 20 20 7b 20 |s do.. | { |
|00000c30| 5b 61 6e 79 74 68 69 6e | 67 20 74 6f 20 66 69 74 |[anythin|g to fit|
|00000c40| 20 69 6e 20 38 30 20 63 | 6f 6c 75 6d 6e 73 21 5d | in 80 c|olumns!]|
|00000c50| 20 7d 0d 20 20 20 20 20 | 20 20 20 62 61 73 65 61 | }. | basea|
|00000c60| 64 64 72 20 3a 3d 20 71 | 64 70 74 72 20 28 6c 6f |ddr := q|dptr (lo|
|00000c70| 6e 67 69 6e 74 28 62 61 | 73 65 61 64 64 72 29 20 |ngint(ba|seaddr) |
|00000c80| 2d 20 33 32 37 36 38 29 | 3b 20 7b 20 c9 62 61 73 |- 32768)|; { .bas|
|00000c90| 65 20 69 73 20 33 32 4b | 20 6c 65 73 73 20 7d 0d |e is 32K| less }.|
|00000ca0| 0d 20 20 20 20 20 20 45 | 72 61 73 65 52 65 63 74 |. E|raseRect|
|00000cb0| 20 28 74 68 65 50 6f 72 | 74 5e 2e 70 6f 72 74 62 | (thePor|t^.portb|
|00000cc0| 69 74 73 2e 62 6f 75 6e | 64 73 29 3b 20 7b 20 65 |its.boun|ds); { e|
|00000cd0| 72 61 73 65 20 74 68 65 | 20 75 73 75 61 6c 20 73 |rase the| usual s|
|00000ce0| 63 72 65 65 6e 20 7d 0d | 20 20 20 20 20 20 46 69 |creen }.| Fi|
|00000cf0| 6c 6c 52 65 63 74 20 28 | 62 6f 75 6e 64 73 72 65 |llRect (|boundsre|
|00000d00| 63 74 2c 20 67 72 61 79 | 29 3b 20 20 20 20 20 20 |ct, gray|); |
|00000d10| 7b 20 64 72 61 77 20 74 | 68 65 20 62 6f 75 6e 64 |{ draw t|he bound|
|00000d20| 61 72 79 20 77 65 20 62 | 6f 75 6e 63 65 20 69 6e |ary we b|ounce in|
|00000d30| 20 7d 0d 20 20 20 20 20 | 20 43 6f 70 79 42 69 74 | }. | CopyBit|
|00000d40| 73 20 28 73 63 72 65 65 | 6e 62 69 74 73 2c 20 61 |s (scree|nbits, a|
|00000d50| 6c 74 62 69 74 73 2c 20 | 20 20 20 7b 20 63 6f 70 |ltbits, | { cop|
|00000d60| 79 20 61 6c 6c 20 6f 66 | 20 74 68 69 73 20 74 6f |y all of| this to|
|00000d70| 20 61 6c 74 20 73 63 72 | 65 65 6e 2c 20 74 6f 6f | alt scr|een, too|
|00000d80| 20 7d 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00000d90| 20 20 20 73 63 72 65 65 | 6e 62 69 74 73 2e 62 6f | scree|nbits.bo|
|00000da0| 75 6e 64 73 2c 20 61 6c | 74 62 69 74 73 2e 62 6f |unds, al|tbits.bo|
|00000db0| 75 6e 64 73 2c 20 73 72 | 63 43 6f 70 79 2c 20 4e |unds, sr|cCopy, N|
|00000dc0| 49 4c 29 3b 0d 0d 20 20 | 20 20 20 20 77 68 69 63 |IL);.. | whic|
|00000dd0| 68 73 63 72 20 3a 3d 20 | 64 65 66 61 75 6c 74 3b |hscr := |default;|
|00000de0| 09 20 20 20 20 20 20 20 | 20 7b 20 73 74 61 72 74 |. | { start|
|00000df0| 20 6f 75 74 20 6f 6e 20 | 74 68 65 20 64 65 66 61 | out on |the defa|
|00000e00| 75 6c 74 20 70 61 67 65 | 20 7d 0d 20 20 20 20 20 |ult page| }. |
|00000e10| 20 76 68 20 3a 3d 20 35 | 20 2a 20 74 69 63 6b 72 | vh := 5| * tickr|
|00000e20| 61 74 65 3b 20 76 76 20 | 3a 3d 20 33 20 2a 20 74 |ate; vv |:= 3 * t|
|00000e30| 69 63 6b 72 61 74 65 3b | 20 7b 20 70 69 63 6b 20 |ickrate;| { pick |
|00000e40| 61 6e 79 20 6f 6c 64 20 | 73 70 65 65 64 c9 20 7d |any old |speed. }|
|00000e50| 0d 20 20 20 20 20 20 73 | 61 6d 70 6c 65 73 20 3a |. s|amples :|
|00000e60| 3d 20 30 3b 20 74 6f 74 | 66 72 65 65 74 69 6d 65 |= 0; tot|freetime|
|00000e70| 20 3a 3d 20 30 3b 20 20 | 20 7b 20 69 6e 69 74 69 | := 0; | { initi|
|00000e80| 61 6c 69 7a 65 20 73 74 | 61 74 69 73 74 69 63 73 |alize st|atistics|
|00000e90| 20 7d 0d 0d 20 20 20 20 | 20 20 76 69 64 73 74 61 | }.. | vidsta|
|00000ea0| 72 74 20 28 74 68 65 69 | 6e 66 6f 2c 20 74 69 63 |rt (thei|nfo, tic|
|00000eb0| 6b 72 61 74 65 29 3b 20 | 20 20 20 20 7b 20 73 74 |krate); | { st|
|00000ec0| 61 72 74 20 73 63 72 65 | 65 6e 2d 73 77 69 74 63 |art scre|en-switc|
|00000ed0| 68 20 74 61 73 6b 20 72 | 75 6e 6e 69 6e 67 20 7d |h task r|unning }|
|00000ee0| 0d 20 20 65 6e 64 3b 09 | 09 09 09 20 20 20 20 20 |. end;.|... |
|00000ef0| 20 20 20 7b 20 6f 66 20 | 70 72 6f 63 65 64 75 72 | { of |procedur|
|00000f00| 65 20 69 6e 69 74 20 7d | 0d 0d 20 20 7b 20 73 68 |e init }|.. { sh|
|00000f10| 6f 77 73 74 61 74 73 20 | 2d 2d 20 50 72 69 6e 74 |owstats |-- Print|
|00000f20| 20 73 74 61 74 69 73 74 | 69 63 73 20 69 6e 20 77 | statist|ics in w|
|00000f30| 68 61 74 65 76 65 72 20 | 77 61 79 20 79 6f 75 20 |hatever |way you |
|00000f40| 6c 69 6b 65 2e 20 20 49 | 20 64 6f 6e 27 74 20 70 |like. I| don't p|
|00000f50| 72 69 6e 74 0d 20 20 20 | 20 74 68 65 6d 20 75 6e |rint. | them un|
|00000f60| 74 69 6c 20 74 68 65 72 | 65 20 61 72 65 20 61 20 |til ther|e are a |
|00000f70| 66 61 69 72 20 6e 75 6d | 62 65 72 20 6f 66 20 73 |fair num|ber of s|
|00000f80| 61 6d 70 6c 65 73 20 61 | 63 63 75 6d 75 6c 61 74 |amples a|ccumulat|
|00000f90| 65 64 2e 20 20 41 6c 73 | 6f 2c 20 74 68 65 0d 20 |ed. Als|o, the. |
|00000fa0| 20 20 20 63 6f 64 65 20 | 62 65 6c 6f 77 20 70 72 | code |below pr|
|00000fb0| 69 6e 74 73 20 73 74 61 | 74 73 20 6f 6e 6c 79 20 |ints sta|ts only |
|00000fc0| 77 68 65 6e 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |when the| number |
|00000fd0| 6f 66 20 73 61 6d 70 6c | 65 73 20 69 73 20 61 20 |of sampl|es is a |
|00000fe0| 70 6f 77 65 72 20 6f 66 | 0d 20 20 20 20 74 77 6f |power of|. two|
|00000ff0| 2c 20 73 6f 20 74 68 65 | 20 66 72 65 71 75 65 6e |, so the| frequen|
|00001000| 63 79 20 6f 66 20 64 65 | 62 75 67 67 69 6e 67 20 |cy of de|bugging |
|00001010| 6f 75 74 70 75 74 20 64 | 65 63 72 65 61 73 65 73 |output d|ecreases|
|00001020| 20 65 78 70 6f 6e 65 6e | 74 69 61 6c 6c 79 2e 20 | exponen|tially. |
|00001030| 7d 0d 20 20 20 20 0d 20 | 20 70 72 6f 63 65 64 75 |}. . | procedu|
|00001040| 72 65 20 73 68 6f 77 73 | 74 61 74 73 20 28 73 61 |re shows|tats (sa|
|00001050| 6d 70 6c 65 73 2c 20 74 | 6f 74 66 72 65 65 2c 20 |mples, t|otfree, |
|00001060| 64 65 6c 61 79 73 3a 20 | 6c 6f 6e 67 69 6e 74 29 |delays: |longint)|
|00001070| 3b 0d 20 20 62 65 67 69 | 6e 3b 0d 20 20 20 20 69 |;. begi|n;. i|
|00001080| 66 20 73 61 6d 70 6c 65 | 73 20 3e 20 32 30 30 20 |f sample|s > 200 |
|00001090| 0d 20 20 20 20 74 68 65 | 6e 20 62 65 67 69 6e 3b |. the|n begin;|
|000010a0| 09 7b 20 64 6f 6e 27 74 | 20 70 72 69 6e 74 20 66 |.{ don't| print f|
|000010b0| 6f 72 20 61 20 77 68 69 | 6c 65 20 7d 0d 20 20 20 |or a whi|le }. |
|000010c0| 20 0d 20 20 20 20 09 7b | 20 54 68 65 20 6f 64 64 | . .{| The odd|
|000010d0| 20 d2 69 66 d3 20 62 65 | 6c 6f 77 20 6d 61 6b 65 | .if. be|low make|
|000010e0| 73 20 75 73 20 70 72 69 | 6e 74 20 6f 6e 6c 79 20 |s us pri|nt only |
|000010f0| 77 68 65 6e 20 d2 73 61 | 6d 70 6c 65 73 d3 20 69 |when .sa|mples. i|
|00001100| 73 20 61 20 70 6f 77 65 | 72 20 6f 66 20 32 2e 20 |s a powe|r of 2. |
|00001110| 7d 0d 20 20 20 20 09 69 | 66 20 42 69 74 41 6e 64 |}. .i|f BitAnd|
|00001120| 20 28 73 61 6d 70 6c 65 | 73 2c 20 2d 73 61 6d 70 | (sample|s, -samp|
|00001130| 6c 65 73 29 20 3d 20 73 | 61 6d 70 6c 65 73 20 0d |les) = s|amples .|
|00001140| 20 20 20 20 09 74 68 65 | 6e 20 62 65 67 69 6e 20 | .the|n begin |
|00001150| 3b 0d 09 09 7b 70 72 69 | 6e 74 20 72 6f 75 74 69 |;...{pri|nt routi|
|00001160| 6e 65 73 20 67 6f 20 68 | 65 72 65 7d 0d 09 65 6e |nes go h|ere}..en|
|00001170| 64 3b 0d 20 20 20 20 65 | 6e 64 3b 0d 20 20 65 6e |d;. e|nd;. en|
|00001180| 64 3b 09 09 09 09 20 20 | 20 20 20 20 20 20 7b 20 |d;.... | { |
|00001190| 70 72 6f 63 65 64 75 72 | 65 20 73 68 6f 77 73 74 |procedur|e showst|
|000011a0| 61 74 73 20 7d 0d 0d 20 | 20 7b 20 61 6e 69 6d 61 |ats }.. | { anima|
|000011b0| 74 65 20 2d 2d 20 50 72 | 65 70 61 72 65 20 61 6e |te -- Pr|epare an|
|000011c0| 64 20 64 69 73 70 6c 61 | 79 20 74 68 65 20 6e 65 |d displa|y the ne|
|000011d0| 78 74 20 66 72 61 6d 65 | 20 6f 66 20 61 6e 69 6d |xt frame| of anim|
|000011e0| 61 74 69 6f 6e 2e 09 20 | 43 6f 6d 70 75 74 65 20 |ation.. |Compute |
|000011f0| 74 68 65 0d 20 20 20 20 | 6e 65 77 20 70 6f 73 69 |the. |new posi|
|00001200| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 62 6c 6f 63 |tion of |the bloc|
|00001210| 6b 2c 20 69 6e 63 6c 75 | 64 69 6e 67 20 62 6f 75 |k, inclu|ding bou|
|00001220| 6e 63 69 6e 67 20 6f 66 | 66 20 74 68 65 20 77 61 |ncing of|f the wa|
|00001230| 6c 6c 73 2e 20 20 57 61 | 69 74 20 66 6f 72 20 74 |lls. Wa|it for t|
|00001240| 68 65 0d 20 20 20 20 76 | 69 64 65 6f 20 73 77 69 |he. v|ideo swi|
|00001250| 74 63 68 65 72 20 74 6f | 20 66 69 6e 69 73 68 20 |tcher to| finish |
|00001260| 64 69 73 70 6c 61 79 69 | 6e 67 20 6f 6e 65 20 70 |displayi|ng one p|
|00001270| 61 67 65 20 73 6f 20 77 | 65 20 63 61 6e 20 64 72 |age so w|e can dr|
|00001280| 61 77 20 69 6e 20 69 74 | 2e 20 20 53 65 74 0d 20 |aw in it|. Set. |
|00001290| 20 20 20 51 75 69 63 6b | 64 72 61 77 20 74 6f 20 | Quick|draw to |
|000012a0| 64 72 61 77 69 6e 67 20 | 69 6e 20 69 74 3b 20 65 |drawing |in it; e|
|000012b0| 72 61 73 65 20 74 68 65 | 20 6c 61 73 74 20 62 6c |rase the| last bl|
|000012c0| 6f 63 6b 20 64 72 61 77 | 6e 20 61 6e 64 20 64 72 |ock draw|n and dr|
|000012d0| 61 77 20 74 68 65 20 6e | 65 77 0d 20 20 20 20 6f |aw the n|ew. o|
|000012e0| 6e 65 2e 20 20 54 65 6c | 6c 20 74 68 65 20 76 69 |ne. Tel|l the vi|
|000012f0| 64 65 6f 20 73 77 69 74 | 63 68 65 72 20 77 65 27 |deo swit|cher we'|
|00001300| 72 65 20 72 65 61 64 79 | 20 74 6f 20 68 61 76 65 |re ready| to have|
|00001310| 20 74 68 69 73 20 6e 65 | 77 73 63 72 65 65 6e 20 | this ne|wscreen |
|00001320| 73 68 6f 77 6e 2e 7d 0d | 20 20 20 20 0d 20 20 70 |shown.}.| . p|
|00001330| 72 6f 63 65 64 75 72 65 | 20 61 6e 69 6d 61 74 65 |rocedure| animate|
|00001340| 3b 09 09 20 20 20 20 20 | 20 20 20 7b 20 64 72 61 |;.. | { dra|
|00001350| 77 20 74 68 65 20 6e 65 | 78 74 20 70 6f 73 69 74 |w the ne|xt posit|
|00001360| 69 6f 6e 20 7d 0d 20 20 | 76 61 72 20 66 72 65 65 |ion }. |var free|
|00001370| 74 69 6d 65 3a 20 6c 6f | 6e 67 69 6e 74 3b 09 20 |time: lo|ngint;. |
|00001380| 20 20 20 20 20 20 20 7b | 20 64 65 6c 61 79 20 62 | {| delay b|
|00001390| 65 66 6f 72 65 20 73 77 | 69 74 63 68 20 69 73 20 |efore sw|itch is |
|000013a0| 64 6f 6e 65 20 7d 0d 20 | 20 62 65 67 69 6e 3b 0d |done }. | begin;.|
|000013b0| 20 20 20 20 4f 66 66 73 | 65 74 52 65 63 74 20 28 | Offs|etRect (|
|000013c0| 62 6c 6f 63 6b 72 65 63 | 74 2c 20 76 68 2c 20 76 |blockrec|t, vh, v|
|000013d0| 76 29 3b 20 20 20 20 20 | 7b 20 6d 6f 76 65 20 74 |v); |{ move t|
|000013e0| 6f 20 74 68 65 20 6e 65 | 78 74 20 70 6f 73 69 74 |o the ne|xt posit|
|000013f0| 69 6f 6e 20 7d 0d 0d 20 | 20 20 20 7b 20 54 68 65 |ion }.. | { The|
|00001400| 73 65 20 66 6f 75 72 20 | d2 69 66 d3 73 20 20 61 |se four |.if.s a|
|00001410| 6c 6c 20 63 68 65 63 6b | 20 69 66 20 74 68 65 20 |ll check| if the |
|00001420| 62 6c 6f 63 6b 20 68 61 | 73 20 67 6f 6e 65 20 6f |block ha|s gone o|
|00001430| 75 74 73 69 64 65 20 74 | 68 65 20 62 6f 75 6e 64 |utside t|he bound|
|00001440| 73 0d 20 20 20 20 20 20 | 72 65 63 74 61 6e 67 6c |s. |rectangl|
|00001450| 65 2e 20 20 49 66 20 73 | 6f 2c 20 74 68 65 20 62 |e. If s|o, the b|
|00001460| 6c 6f 63 6b 20 69 73 20 | 61 64 6a 75 73 74 65 64 |lock is |adjusted|
|00001470| 20 69 6e 20 74 68 65 20 | 61 70 70 72 6f 70 72 69 | in the |appropri|
|00001480| 61 74 65 20 64 69 72 65 | 63 74 69 6f 6e 0d 20 20 |ate dire|ction. |
|00001490| 20 20 20 20 28 76 20 6f | 72 20 68 29 2c 20 61 6e | (v o|r h), an|
|000014a0| 64 20 61 20 76 65 6c 6f | 63 69 74 79 20 63 6f 6d |d a velo|city com|
|000014b0| 70 6f 6e 65 6e 74 20 28 | 76 76 20 6f 72 20 76 68 |ponent (|vv or vh|
|000014c0| 29 20 69 73 20 6e 65 67 | 61 74 65 64 2e 20 7d 0d |) is neg|ated. }.|
|000014d0| 20 20 20 20 69 66 20 62 | 6c 6f 63 6b 72 65 63 74 | if b|lockrect|
|000014e0| 2e 62 6f 74 74 6f 6d 20 | 3e 20 62 6f 75 6e 64 73 |.bottom |> bounds|
|000014f0| 72 65 63 74 2e 62 6f 74 | 74 6f 6d 20 20 20 20 20 |rect.bot|tom |
|00001500| 7b 20 62 6f 75 6e 63 65 | 20 6f 66 66 20 74 68 65 |{ bounce| off the|
|00001510| 20 62 6f 74 74 6f 6d 3f | 20 7d 0d 20 20 20 20 74 | bottom?| }. t|
|00001520| 68 65 6e 20 62 65 67 69 | 6e 3b 0d 20 20 20 20 20 |hen begi|n;. |
|00001530| 20 4f 66 66 73 65 74 52 | 65 63 74 20 28 62 6c 6f | OffsetR|ect (blo|
|00001540| 63 6b 72 65 63 74 2c 20 | 30 2c 20 32 20 2a 20 28 |ckrect, |0, 2 * (|
|00001550| 62 6f 75 6e 64 73 72 65 | 63 74 2e 62 6f 74 74 6f |boundsre|ct.botto|
|00001560| 6d 2d 62 6c 6f 63 6b 72 | 65 63 74 2e 62 6f 74 74 |m-blockr|ect.bott|
|00001570| 6f 6d 29 29 3b 0d 20 20 | 20 20 20 20 76 76 20 3a |om));. | vv :|
|00001580| 3d 20 2d 20 76 76 3b 0d | 20 20 20 20 65 6e 64 3b |= - vv;.| end;|
|00001590| 0d 20 20 20 20 69 66 20 | 62 6c 6f 63 6b 72 65 63 |. if |blockrec|
|000015a0| 74 2e 74 6f 70 20 3c 20 | 62 6f 75 6e 64 73 72 65 |t.top < |boundsre|
|000015b0| 63 74 2e 74 6f 70 09 20 | 20 20 20 20 20 20 20 7b |ct.top. | {|
|000015c0| 20 62 6f 75 6e 63 65 20 | 6f 66 66 20 74 68 65 20 | bounce |off the |
|000015d0| 74 6f 70 3f 20 7d 0d 20 | 20 20 20 74 68 65 6e 20 |top? }. | then |
|000015e0| 62 65 67 69 6e 3b 0d 20 | 20 20 20 20 20 4f 66 66 |begin;. | Off|
|000015f0| 73 65 74 52 65 63 74 20 | 28 62 6c 6f 63 6b 72 65 |setRect |(blockre|
|00001600| 63 74 2c 20 30 2c 20 32 | 20 2a 20 28 62 6f 75 6e |ct, 0, 2| * (boun|
|00001610| 64 73 72 65 63 74 2e 74 | 6f 70 2d 62 6c 6f 63 6b |dsrect.t|op-block|
|00001620| 72 65 63 74 2e 74 6f 70 | 29 29 3b 0d 20 20 20 20 |rect.top|));. |
|00001630| 20 20 76 76 20 3a 3d 20 | 2d 20 76 76 3b 0d 20 20 | vv := |- vv;. |
|00001640| 20 20 65 6e 64 3b 0d 20 | 20 20 20 69 66 20 62 6c | end;. | if bl|
|00001650| 6f 63 6b 72 65 63 74 2e | 6c 65 66 74 20 3c 20 62 |ockrect.|left < b|
|00001660| 6f 75 6e 64 73 72 65 63 | 74 2e 6c 65 66 74 09 20 |oundsrec|t.left. |
|00001670| 20 20 20 20 20 20 20 7b | 20 62 6f 75 6e 63 65 20 | {| bounce |
|00001680| 6f 66 66 20 74 68 65 20 | 6c 65 66 74 3f 20 7d 0d |off the |left? }.|
|00001690| 20 20 20 20 74 68 65 6e | 20 62 65 67 69 6e 3b 0d | then| begin;.|
|000016a0| 20 20 20 20 20 20 4f 66 | 66 73 65 74 52 65 63 74 | Of|fsetRect|
|000016b0| 20 28 62 6c 6f 63 6b 72 | 65 63 74 2c 20 32 20 2a | (blockr|ect, 2 *|
|000016c0| 20 28 62 6f 75 6e 64 73 | 72 65 63 74 2e 6c 65 66 | (bounds|rect.lef|
|000016d0| 74 2d 62 6c 6f 63 6b 72 | 65 63 74 2e 6c 65 66 74 |t-blockr|ect.left|
|000016e0| 29 2c 20 30 29 3b 0d 20 | 20 20 20 20 20 76 68 20 |), 0);. | vh |
|000016f0| 3a 3d 20 2d 76 68 3b 0d | 20 20 20 20 65 6e 64 3b |:= -vh;.| end;|
|00001700| 0d 20 20 20 20 69 66 20 | 62 6c 6f 63 6b 72 65 63 |. if |blockrec|
|00001710| 74 2e 72 69 67 68 74 20 | 3e 20 62 6f 75 6e 64 73 |t.right |> bounds|
|00001720| 72 65 63 74 2e 72 69 67 | 68 74 20 20 20 20 20 20 |rect.rig|ht |
|00001730| 20 7b 20 62 6f 75 6e 63 | 65 20 6f 66 66 20 74 68 | { bounc|e off th|
|00001740| 65 20 72 69 67 68 74 3f | 20 7d 0d 20 20 20 20 74 |e right?| }. t|
|00001750| 68 65 6e 20 62 65 67 69 | 6e 3b 0d 20 20 20 20 20 |hen begi|n;. |
|00001760| 20 4f 66 66 73 65 74 52 | 65 63 74 20 28 62 6c 6f | OffsetR|ect (blo|
|00001770| 63 6b 72 65 63 74 2c 20 | 32 20 2a 20 28 62 6f 75 |ckrect, |2 * (bou|
|00001780| 6e 64 73 72 65 63 74 2e | 72 69 67 68 74 2d 62 6c |ndsrect.|right-bl|
|00001790| 6f 63 6b 72 65 63 74 2e | 72 69 67 68 74 29 2c 20 |ockrect.|right), |
|000017a0| 30 29 3b 0d 20 20 20 20 | 20 20 76 68 20 3a 3d 20 |0);. | vh := |
|000017b0| 2d 76 68 3b 0d 20 20 20 | 20 65 6e 64 3b 0d 0d 20 |-vh;. | end;.. |
|000017c0| 20 20 20 66 72 65 65 74 | 69 6d 65 20 3a 3d 20 76 | freet|ime := v|
|000017d0| 69 64 77 61 69 74 20 28 | 74 68 65 69 6e 66 6f 29 |idwait (|theinfo)|
|000017e0| 3b 20 20 20 20 20 20 7b | 20 77 61 69 74 20 66 6f |; {| wait fo|
|000017f0| 72 20 70 61 67 65 20 74 | 6f 20 73 77 69 74 63 68 |r page t|o switch|
|00001800| 20 7d 0d 20 20 20 20 74 | 6f 74 66 72 65 65 74 69 | }. t|otfreeti|
|00001810| 6d 65 20 3a 3d 20 74 6f | 74 66 72 65 65 74 69 6d |me := to|tfreetim|
|00001820| 65 20 2b 20 66 72 65 65 | 74 69 6d 65 3b 20 7b 20 |e + free|time; { |
|00001830| 6b 65 65 70 20 74 72 61 | 63 6b 20 6f 66 20 74 6f |keep tra|ck of to|
|00001840| 74 61 6c 20 77 61 69 74 | c9 20 7d 0d 20 20 20 20 |tal wait|. }. |
|00001850| 73 61 6d 70 6c 65 73 20 | 3a 3d 20 73 61 6d 70 6c |samples |:= sampl|
|00001860| 65 73 20 2b 20 31 3b 09 | 20 20 20 20 20 20 20 20 |es + 1;.| |
|00001870| 7b 20 c9 61 6e 64 20 6e | 75 6d 62 65 72 20 6f 66 |{ .and n|umber of|
|00001880| 20 73 61 6d 70 6c 65 73 | 20 69 6e 20 61 76 65 72 | samples| in aver|
|00001890| 61 67 65 20 7d 0d 20 20 | 20 20 73 68 6f 77 73 74 |age }. | showst|
|000018a0| 61 74 73 20 28 73 61 6d | 70 6c 65 73 2c 20 74 6f |ats (sam|ples, to|
|000018b0| 74 66 72 65 65 74 69 6d | 65 2c 20 74 68 65 69 6e |tfreetim|e, thein|
|000018c0| 66 6f 2e 64 65 6c 61 79 | 73 29 3b 0d 0d 20 20 20 |fo.delay|s);.. |
|000018d0| 20 69 66 20 77 68 69 63 | 68 73 63 72 20 3d 20 64 | if whic|hscr = d|
|000018e0| 65 66 61 75 6c 74 09 20 | 20 20 20 20 20 20 20 7b |efault. | {|
|000018f0| 20 63 75 72 72 65 6e 74 | 6c 79 20 73 68 6f 77 69 | current|ly showi|
|00001900| 6e 67 20 64 65 66 61 75 | 6c 74 20 73 63 72 65 65 |ng defau|lt scree|
|00001910| 6e 3f 20 7d 0d 20 20 20 | 20 74 68 65 6e 20 62 65 |n? }. | then be|
|00001920| 67 69 6e 3b 09 09 09 20 | 20 20 20 20 20 20 20 7b |gin;... | {|
|00001930| 20 79 65 73 3a 20 6e 65 | 78 74 20 66 72 61 6d 65 | yes: ne|xt frame|
|00001940| 20 69 73 20 6f 6e 20 61 | 6c 74 20 73 63 72 65 65 | is on a|lt scree|
|00001950| 6e 20 7d 0d 20 20 20 20 | 20 20 53 65 74 50 6f 72 |n }. | SetPor|
|00001960| 74 42 69 74 73 20 28 61 | 6c 74 62 69 74 73 29 3b |tBits (a|ltbits);|
|00001970| 09 20 20 20 20 20 20 20 | 20 7b 20 6d 61 6b 65 20 |. | { make |
|00001980| 51 75 69 63 6b 64 72 61 | 77 20 64 72 61 77 20 6f |Quickdra|w draw o|
|00001990| 6e 20 61 6c 74 2e 20 62 | 69 74 6d 61 70 20 7d 0d |n alt. b|itmap }.|
|000019a0| 20 20 20 20 20 20 46 69 | 6c 6c 52 65 63 74 20 28 | Fi|llRect (|
|000019b0| 61 6c 74 6c 61 73 74 2c | 20 67 72 61 79 29 3b 09 |altlast,| gray);.|
|000019c0| 20 20 20 20 20 20 20 20 | 7b 20 63 6c 65 61 6e 20 | |{ clean |
|000019d0| 75 70 20 6c 61 73 74 20 | 70 6c 61 63 65 20 77 65 |up last |place we|
|000019e0| 20 64 72 65 77 20 7d 0d | 20 20 20 20 20 20 61 6c | drew }.| al|
|000019f0| 74 6c 61 73 74 20 3a 3d | 20 62 6c 6f 63 6b 72 65 |tlast :=| blockre|
|00001a00| 63 74 3b 09 20 20 20 20 | 20 20 20 20 7b 20 72 65 |ct;. | { re|
|00001a10| 6d 65 6d 62 65 72 20 77 | 68 65 72 65 20 77 65 27 |member w|here we'|
|00001a20| 72 65 20 64 72 61 77 69 | 6e 67 20 6e 6f 77 20 7d |re drawi|ng now }|
|00001a30| 0d 20 20 20 20 20 20 46 | 69 6c 6c 52 65 63 74 20 |. F|illRect |
|00001a40| 28 61 6c 74 6c 61 73 74 | 2c 20 62 6c 61 63 6b 29 |(altlast|, black)|
|00001a50| 3b 20 20 20 20 20 20 20 | 20 7b 20 61 6e 64 20 64 |; | { and d|
|00001a60| 72 61 77 20 6e 65 77 20 | 69 6d 61 67 65 20 7d 0d |raw new |image }.|
|00001a70| 20 20 20 20 20 20 77 68 | 69 63 68 73 63 72 20 3a | wh|ichscr :|
|00001a80| 3d 20 61 6c 74 65 72 6e | 61 74 65 3b 09 20 20 20 |= altern|ate;. |
|00001a90| 20 20 20 20 20 7b 20 72 | 65 6d 65 6d 62 65 72 20 | { r|emember |
|00001aa0| 77 68 65 72 65 20 6c 61 | 74 65 73 74 20 69 6d 61 |where la|test ima|
|00001ab0| 67 65 20 69 73 c9 20 7d | 0d 20 20 20 20 20 20 74 |ge is. }|. t|
|00001ac0| 68 65 69 6e 66 6f 2e 72 | 65 71 75 65 73 74 20 3a |heinfo.r|equest :|
|00001ad0| 3d 20 72 65 71 61 6c 74 | 3b 20 20 20 20 20 20 20 |= reqalt|; |
|00001ae0| 20 7b 20 c9 61 6e 64 20 | 61 73 6b 20 76 69 64 20 | { .and |ask vid |
|00001af0| 73 77 69 74 63 68 65 72 | 20 74 6f 20 73 68 6f 77 |switcher| to show|
|00001b00| 20 69 74 20 7d 0d 20 20 | 20 20 65 6e 64 09 09 09 | it }. | end...|
|00001b10| 09 20 20 20 20 20 20 20 | 20 7b 20 65 6e 64 20 6f |. | { end o|
|00001b20| 66 20 64 6f 69 6e 67 20 | 66 72 61 6d 65 20 6f 6e |f doing |frame on|
|00001b30| 20 61 6c 74 20 73 63 72 | 65 65 6e 20 7d 0d 20 20 | alt scr|een }. |
|00001b40| 20 20 65 6c 73 65 20 62 | 65 67 69 6e 3b 09 09 09 | else b|egin;...|
|00001b50| 20 20 20 20 20 20 20 20 | 7b 20 6e 6f 3a 20 6e 65 | |{ no: ne|
|00001b60| 78 74 20 66 72 61 6d 65 | 20 69 73 20 6f 6e 20 64 |xt frame| is on d|
|00001b70| 65 66 61 75 6c 74 20 73 | 63 72 65 65 6e 20 7d 0d |efault s|creen }.|
|00001b80| 20 20 20 20 20 20 53 65 | 74 50 6f 72 74 42 69 74 | Se|tPortBit|
|00001b90| 73 20 28 73 63 72 65 65 | 6e 62 69 74 73 29 3b 09 |s (scree|nbits);.|
|00001ba0| 20 20 20 20 20 20 20 20 | 7b 20 70 6f 69 6e 74 20 | |{ point |
|00001bb0| 51 75 69 63 6b 64 72 61 | 77 20 74 6f 20 64 65 66 |Quickdra|w to def|
|00001bc0| 61 75 6c 74 20 73 63 72 | 65 65 6e 20 7d 0d 20 20 |ault scr|een }. |
|00001bd0| 20 20 20 20 46 69 6c 6c | 52 65 63 74 20 28 64 65 | Fill|Rect (de|
|00001be0| 66 6c 61 73 74 2c 20 67 | 72 61 79 29 3b 09 20 20 |flast, g|ray);. |
|00001bf0| 20 20 20 20 20 20 7b 20 | 65 72 61 73 65 20 6c 61 | { |erase la|
|00001c00| 73 74 20 69 6d 61 67 65 | 20 77 65 20 64 72 65 77 |st image| we drew|
|00001c10| 20 7d 0d 20 20 20 20 20 | 20 64 65 66 6c 61 73 74 | }. | deflast|
|00001c20| 20 3a 3d 20 62 6c 6f 63 | 6b 72 65 63 74 3b 09 20 | := bloc|krect;. |
|00001c30| 20 20 20 20 20 20 20 7b | 20 72 65 6d 65 6d 62 65 | {| remembe|
|00001c40| 72 20 77 68 65 72 65 20 | 77 65 27 72 65 20 70 75 |r where |we're pu|
|00001c50| 74 74 69 6e 67 20 62 6c | 6f 63 6b 20 7d 0d 20 20 |tting bl|ock }. |
|00001c60| 20 20 20 20 46 69 6c 6c | 52 65 63 74 20 28 64 65 | Fill|Rect (de|
|00001c70| 66 6c 61 73 74 2c 20 62 | 6c 61 63 6b 29 3b 20 20 |flast, b|lack); |
|00001c80| 20 20 20 20 20 20 7b 20 | 70 75 74 20 69 74 20 74 | { |put it t|
|00001c90| 68 65 72 65 20 7d 0d 20 | 20 20 20 20 20 77 68 69 |here }. | whi|
|00001ca0| 63 68 73 63 72 20 3a 3d | 20 64 65 66 61 75 6c 74 |chscr :=| default|
|00001cb0| 3b 09 20 20 20 20 20 20 | 20 20 7b 20 72 65 6d 65 |;. | { reme|
|00001cc0| 6d 62 65 72 20 77 68 69 | 63 68 20 73 63 72 65 65 |mber whi|ch scree|
|00001cd0| 6e 20 69 73 20 64 69 73 | 70 6c 61 79 65 64 20 7d |n is dis|played }|
|00001ce0| 0d 20 20 20 20 20 20 74 | 68 65 69 6e 66 6f 2e 72 |. t|heinfo.r|
|00001cf0| 65 71 75 65 73 74 20 3a | 3d 20 72 65 71 64 65 66 |equest :|= reqdef|
|00001d00| 3b 20 20 20 20 20 20 20 | 20 7b 20 61 73 6b 20 76 |; | { ask v|
|00001d10| 69 64 65 6f 20 73 77 69 | 74 63 68 65 72 20 74 6f |ideo swi|tcher to|
|00001d20| 20 73 68 6f 77 20 64 65 | 66 61 75 6c 74 20 7d 0d | show de|fault }.|
|00001d30| 20 20 20 20 65 6e 64 3b | 09 09 09 20 20 20 20 20 | end;|... |
|00001d40| 20 20 20 7b 20 6f 66 20 | 62 72 61 6e 63 68 69 6e | { of |branchin|
|00001d50| 67 20 6f 6e 20 77 68 69 | 63 68 20 73 63 72 65 65 |g on whi|ch scree|
|00001d60| 6e 20 7d 0d 20 20 65 6e | 64 3b 09 09 09 09 20 20 |n }. en|d;.... |
|00001d70| 20 20 20 20 20 20 7b 20 | 70 72 6f 63 65 64 75 72 | { |procedur|
|00001d80| 65 20 61 6e 69 6d 61 74 | 65 20 7d 0d 0d 20 20 62 |e animat|e }.. b|
|00001d90| 65 67 69 6e 3b 09 09 09 | 20 20 20 20 20 20 20 20 |egin;...| |
|00001da0| 7b 20 4d 41 49 4e 20 50 | 52 4f 47 52 41 4d 20 7d |{ MAIN P|ROGRAM }|
|00001db0| 0d 20 20 20 20 67 65 74 | 61 6c 74 73 63 72 65 65 |. get|altscree|
|00001dc0| 6e 3b 09 09 20 20 20 20 | 20 20 20 20 7b 20 66 69 |n;.. | { fi|
|00001dd0| 72 73 74 2c 20 67 65 74 | 20 74 68 65 20 61 6c 74 |rst, get| the alt|
|00001de0| 65 72 6e 61 74 65 20 73 | 63 72 65 65 6e 20 7d 0d |ernate s|creen }.|
|00001df0| 20 20 20 20 69 6e 69 74 | 3b 09 09 09 20 20 20 20 | init|;... |
|00001e00| 20 20 20 20 7b 20 6e 6f | 77 20 69 6e 69 74 69 61 | { no|w initia|
|00001e10| 6c 69 7a 65 20 65 76 65 | 72 79 74 68 69 6e 67 20 |lize eve|rything |
|00001e20| 65 6c 73 65 20 7d 0d 20 | 20 20 20 46 6c 75 73 68 |else }. | Flush|
|00001e30| 45 76 65 6e 74 73 20 28 | 65 76 65 72 79 65 76 65 |Events (|everyeve|
|00001e40| 6e 74 2c 20 30 29 3b 20 | 20 20 20 20 20 20 20 7b |nt, 0); | {|
|00001e50| 20 69 67 6e 6f 72 65 20 | 6f 6c 64 20 63 6c 69 63 | ignore |old clic|
|00001e60| 6b 73 2c 20 65 74 63 2e | 20 7d 0d 0d 20 20 20 20 |ks, etc.| }.. |
|00001e70| 72 65 70 65 61 74 09 09 | 09 20 20 20 20 20 20 20 |repeat..|. |
|00001e80| 20 7b 20 6c 6f 6f 70 20 | 72 65 70 65 61 74 65 64 | { loop |repeated|
|00001e90| 6c 79 20 7d 0d 20 20 20 | 20 20 20 61 6e 69 6d 61 |ly }. | anima|
|00001ea0| 74 65 3b 09 09 09 20 20 | 20 20 20 20 20 20 7b 20 |te;... | { |
|00001eb0| 64 72 61 77 20 6e 65 78 | 74 20 61 6e 69 6d 61 74 |draw nex|t animat|
|00001ec0| 69 6f 6e 20 66 72 61 6d | 65 20 7d 0d 20 20 20 20 |ion fram|e }. |
|00001ed0| 75 6e 74 69 6c 20 47 65 | 74 4e 65 78 74 45 76 65 |until Ge|tNextEve|
|00001ee0| 6e 74 20 28 6d 44 6f 77 | 6e 4d 61 73 6b 20 2b 20 |nt (mDow|nMask + |
|00001ef0| 6b 65 79 44 6f 77 6e 4d | 61 73 6b 2c 20 61 6e 65 |keyDownM|ask, ane|
|00001f00| 76 65 6e 74 29 3b 20 7b | 20 27 74 69 6c 20 63 6c |vent); {| 'til cl|
|00001f10| 69 63 6b 2f 6b 65 79 20 | 7d 0d 0d 20 20 20 20 74 |ick/key |}.. t|
|00001f20| 68 65 69 6e 66 6f 2e 72 | 65 71 75 65 73 74 20 3a |heinfo.r|equest :|
|00001f30| 3d 20 72 65 71 73 74 6f | 70 3b 09 20 20 20 20 20 |= reqsto|p;. |
|00001f40| 20 20 20 7b 20 6d 61 6b | 65 20 73 75 72 65 20 77 | { mak|e sure w|
|00001f50| 65 20 65 78 69 74 20 6f | 6e 20 64 65 66 61 75 6c |e exit o|n defaul|
|00001f60| 74 20 70 61 67 65 20 7d | 0d 20 20 20 20 7a 6f 74 |t page }|. zot|
|00001f70| 20 3a 3d 20 76 69 64 77 | 61 69 74 20 28 74 68 65 | := vidw|ait (the|
|00001f80| 69 6e 66 6f 29 3b 09 20 | 20 20 20 20 20 20 20 7b |info);. | {|
|00001f90| 20 6d 61 6b 65 20 73 75 | 72 65 20 6c 61 73 74 20 | make su|re last |
|00001fa0| 72 65 71 75 65 73 74 20 | 69 73 20 64 6f 6e 65 20 |request |is done |
|00001fb0| 7d 0d 20 20 20 20 0d 20 | 20 65 6e 64 2e 09 09 09 |}. . | end....|
|00001fc0| 09 20 20 20 20 20 20 20 | 20 7b 20 6f 66 20 6d 61 |. | { of ma|
|00001fd0| 69 6e 20 70 72 6f 67 72 | 61 6d 20 7d 0d 20 20 0d |in progr|am }. .|
|00001fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002000| 00 00 01 00 00 00 01 16 | 00 00 00 16 00 00 00 46 |........|.......F|
|00002010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002030| 0b 76 69 64 64 65 6d 6f | 2e 50 61 73 02 00 00 00 |.viddemo|.Pas....|
|00002040| 54 45 58 54 45 44 49 54 | 01 00 00 68 00 4a 00 00 |TEXTEDIT|...h.J..|
|00002050| 00 00 54 45 58 54 45 44 | 49 54 01 00 00 68 00 4a |..TEXTED|IT...h.J|
|00002060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002070| 00 00 9a de da c2 00 00 | 1f 60 00 00 01 5c 00 00 |........|.`...\..|
|00002080| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002090| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000020f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002100| 00 00 00 0a 00 09 06 4d | 6f 6e 61 63 6f ff 00 00 |.......M|onaco...|
|00002110| 00 04 00 06 00 08 00 00 | 01 00 00 00 01 16 00 00 |........|........|
|00002120| 00 16 00 00 00 46 00 00 | cc 24 02 f2 00 00 00 1c |.....F..|.$......|
|00002130| 00 46 00 01 45 46 4e 54 | 00 00 00 12 45 54 41 42 |.F..EFNT|....ETAB|
|00002140| 00 00 00 1e 03 eb ff ff | 00 00 00 00 00 01 6d 46 |........|......mF|
|00002150| 03 ec ff ff 00 00 00 0e | 00 01 6d 86 00 00 00 00 |........|..m.....|
|00002160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+